package com.agh.szepczynski.magisterka.service.conf;

import org.springframework.context.ApplicationContext;

public class SpringContainer {
	private static SpringContainer instance;
	private ApplicationContext context;

	public SpringContainer(ApplicationContext context) {
		this.context = context;
	}

	public synchronized static SpringContainer getInstance() {
		return instance;
	}

	public static void setInstance(SpringContainer instance) {
		SpringContainer.instance = instance;
	}

	public ApplicationContext getContext() {
		return context;
	}
	public static <T> T getBean(Class<T> obj) {
		return getInstance().getContext().getBean(obj);
	}

}
